#pragma once

#include <windows.h>
#include <cg\cg.h>
#include <cg\cggl.h>
#include <string>

#include "..\RenderEngineUtils\code\TimeControl.h"
#include "..\RenderEngineUtils\SteerCamera.h"
#include "IDemoController.h"
#include "GlExtFactory.h"

#include "..\Sgm\SGMLoader.h"
#include "..\Sgm\Geometry.h"

#include "Triangle.h"
#include "Model.h"
#include "Animation.h"
#include "Ground.h"
#include "Texture.h"
#include "ImagePNG.h"
#include "CamerasManager.h"
#include "MultiModel.h"
#include "MaterialManager.h"
#include "TexturesManager.h"
#include "ModelManager.h"
#include "AnimationManager.h"
#include "ShaderManager.h"
#include "Timeline.h"
#include "LightsManager.h"
#include "Music.h"

#include "Managers.h"

#include "IScene.h"
#include "Scene01.h"
#include "Scene02.h"
#include "Scene03.h"

class DemoController : public IDemoController, public ITimelineObserver
{
private:
	std::string baseDirectory;

	HDC hdc;
	CGcontext context;

	ITimeControl *tc;
	Timeline *timeline;
	float time;
	
	IScene *scene01;
	IScene *scene02;
	IScene *scene03;
	IScene *actScene;

	Music *music;

	//technics 2000, hybrid remixes vol1

	ModelManager *modelMan;
	AnimationManager *animMan;
	MaterialManager *matMan;
	TexturesManager *texMan;
	CamerasManager *camerasManager;
	ShaderManager *vertexShaderMan;
	ShaderManager *pixelShaderMan;
	LightsManager *lightsManager;

	Managers *managers;

	void SetOpenglParams();
	void AssignMaterials();
	void AssignAnimationToCameras();

	void Notify(float time, const char *type, const char *value);

public:
	DemoController(HDC hdc);
	~DemoController(void);

	bool Initialize();
	void LoadData();
	void Start();
	void Process();
	void Stop();
};
